package com.joinlabs.action;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.servlet.ModelAndView;

import com.joinlabs.entity.User;
import com.joinlabs.service.IUserService;
import com.joinlabs.service.IWeiboByTypeidService;
import com.joinlabs.service.IlogByTypenameService;
@Controller
@RequestMapping("/hotClassify")
@SessionAttributes(names= {"user","weiboByTypeidList"})
public class HotClassifyAction {
	@Resource
	   private IUserService userService;//用户
		@Resource
		private IWeiboByTypeidService weiboByTypeidService;//微博
		@Resource
		private IlogByTypenameService logByTypenameService;//日志
		@RequestMapping("/index")
		public ModelAndView hotindex(ModelMap map,String typeidStr){
			//模拟一个登录成功的用户
			User user=userService.selectByPrimaryKey((long)1);
			System.out.println(user);	
			//添加到session域中
			map.addAttribute("user",user);
			
			return new ModelAndView("/hotPage/hotClassify");
		}	
	
	@RequestMapping("/show")
	public String show() {
		return "/hotPage/hotClassify";
	}	
	@RequestMapping("/top")
	public String top() {
		return "/hotPage/Friend";
	}
	@RequestMapping("/hotChild")
	public String hotChild() {
		return "/hotPage/hotChild";
	}
	@RequestMapping("/pageChild")
	public String pageChild() {
		return "/hotPage/pageChild";
	}
	@RequestMapping("/showArticle")
	public String showArticle() {
		return "/articlePage/article";
	}
	@RequestMapping("/detail")
	public String detail() {
		return "/detailPage/detail";
	}
}
